home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 142
/
Volume 142 Oct 17 2011 - Damaged.iso
/
Games
/
operation-graduates.swf
/
scripts
/
frame_41
/
DoAction_2.as
< prev
next >
Wrap
Text File
|
2011-10-17
|
2KB
|
94 lines
function spawnHelix(xSpot, difLevel, whichWay)
{
var _loc1_ = enemyContainer.attachMovie("helixer" + difLevel,"enemy" + eConCount++,eConCount);
_loc1_._x = xSpot;
_loc1_.energy = 15;
switch(difLevel)
{
case 1:
_loc1_.maxSpeed = 5;
_loc1_.turnSpeed = 0.75;
break;
case 2:
_loc1_.maxSpeed = 10;
_loc1_.turnSpeed = 2;
}
_loc1_.route = new Vector(0,_loc1_.maxSpeed);
_loc1_.moveHow = whichWay;
_loc1_.turnTrigger = _loc1_.maxSpeed - 0.001;
_loc1_.Q1logic = baddyQ1;
_loc1_.Q2logic = baddyQ2;
_loc1_.Q3logic = baddyQ3;
_loc1_.Q4logic = baddyQ4;
_loc1_.hit = helixHit;
_loc1_.isHit = false;
_loc1_.move = helixMover;
_loc1_.collide = baddyCollide;
}
function helixHit()
{
var _loc1_ = this;
_loc1_.energy -= 5;
_loc1_.isHit = true;
_loc1_.setRGB(16777215);
if(_loc1_.energy <= 0)
{
playSound("sound.helix.explode");
explode(_loc1_);
addScore(50);
baddyKillCount++;
}
}
function helixMover()
{
var _loc1_ = this;
if(_loc1_.isHit)
{
_loc1_.resetColor();
_loc1_.isHit = false;
}
_loc1_._x += _loc1_.route.x;
_loc1_._y += _loc1_.route.y;
if(_loc1_._y - _loc1_._height / 2 > 400)
{
_loc1_.removeMovieClip();
}
_loc1_._rotation = Math.atan2(_loc1_.route.y,_loc1_.route.x) * 57.29577951308232 - 90;
_loc1_.myShadow._x = (_loc1_._x - 300) / 1.1 + 300;
_loc1_.myShadow._y = (_loc1_._y - 200) / 1.1 + 200;
_loc1_.myShadow._rotation = _loc1_._rotation;
if(_loc1_.moveHow == 0)
{
_loc1_.route.x += _loc1_.turnSpeed;
if(_loc1_.route.x > _loc1_.turnTrigger)
{
_loc1_.moveHow = _loc1_.moveHow + 1;
}
}
else if(_loc1_.moveHow == 1)
{
_loc1_.route.y += _loc1_.turnSpeed;
if(_loc1_.route.y > _loc1_.turnTrigger)
{
_loc1_.moveHow = _loc1_.moveHow + 1;
}
}
else if(_loc1_.moveHow == 2)
{
_loc1_.route.x -= _loc1_.turnSpeed;
if(_loc1_.route.x < - _loc1_.turnTrigger)
{
_loc1_.moveHow = _loc1_.moveHow + 1;
}
}
else if(_loc1_.moveHow == 3)
{
_loc1_.route.y += _loc1_.turnSpeed;
if(_loc1_.route.y > _loc1_.turnTrigger)
{
_loc1_.moveHow = 0;
}
}
_loc1_.route.setLength(_loc1_.maxSpeed);
}